<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        table {
            border-collapse: collapse;
            width: 500px;
            text-align: center;
        }

        /* 2n even 偶数 */
        table tbody tr:nth-child(even) {
            background: pink;
        }

        /* 奇数 2n-1 2n+1 odd */
        table tbody tr:nth-child(odd) {
            background: skyblue;
        }

        /* -n+3 找到前3个 */
        table tbody tr:nth-child(-n+3) {
            color: orange;
        }

        /* n+5 从第三个往后的所有 */
        table tbody tr:nth-child(n+5) {
            color: red;
        }
    </style>
</head>

<body>
    <table border="1">
        <thead>
            <tr>
                <th>姓名</th>
                <th>班级</th>
                <th>年级</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>许**</td>
                <td>165班</td>
                <td>2019</td>
            </tr>
            <tr>
                <td>许**</td>
                <td>165班</td>
                <td>2019</td>
            </tr>
            <tr>
                <td>许**</td>
                <td>165班</td>
                <td>2019</td>
            </tr>
            <tr>
                <td>许**</td>
                <td>165班</td>
                <td>2019</td>
            </tr>
            <tr>
                <td>许**</td>
                <td>165班</td>
                <td>2019</td>
            </tr>
            <tr>
                <td>许**</td>
                <td>165班</td>
                <td>2019</td>
            </tr>
            <tr>
                <td>许**</td>
                <td>165班</td>
                <td>2019</td>
            </tr>
            <tr>
                <td>许**</td>
                <td>165班</td>
                <td>2019</td>
            </tr>
            <tr>
                <td>许**</td>
                <td>165班</td>
                <td>2019</td>
            </tr>
        </tbody>
    </table>
</body>

</html>